<form name="signup" method="post" action="site/class/controller.php">
	<div class="form">
    <h3 id="frmTitle" align="center"> Sign Up Form <br/><small>ALL Fields are Required</small></h3>
    	<table width="100%">
        	<tr>
            <td>Username </td>
            <td width="70%"><input type="text" name="name" size="30" onchange="checkName(this.value);" /><div class="check" id="checkN"></div></td>
            </tr>
            <tr>
            <td>Email</td>
            <td><input type="text" name="email" size="30" /></td>
            </tr>
            <tr>
            <td>Phone Number</td>
            <td><input type="text" name="number" size="30" /></td>
            </tr>
            <tr>
            <td>Sex </td>
            <td><select name="sex">
                <option value="Male">Male</option>
                <option value="Female">Female</option>
            </select>
           	</td>
            </tr>
            <tr>
            <td>New Password</td>
            <td><input type="password" name="password" size="30" /></td>
            </tr>
            <tr>
            <td>Retype Password</td>
            <td><input type="password" name="password2" size="30" onChange="matchPassword();"/><div id="match"></div></td>
            </tr>
            <?php if($adm)
				  { 
			?>
            <tr>
            	<td>Status</td>
                <td>
                	<select name="status">
                    	<option value="0">Non-Approved</option>
                        <option value="1">Approved</option>
                    </select>
                </td>
            </tr>
            <?php
				  }
			?>
            <tr>
            <td colspan="2" align="center"><input type="button" class="button" value="Save" onClick="addUser();" /></td>
            </tr>
        </table>
        <input type="hidden" name="type" value="signup" />
    </div>
</form>

<?php
	if($type == 'edit')
	{		
		require_once('c:/wamp/www/bizbuddy.com/site/class/utility.php');
		$post 	= utility::getPost($id,$content_type);
		$post	= $post[0];
	?>
<script type="text/javascript">
	var frm = document.signup;
	frm.name.value 		= "<?php echo $post['name'];?>";
	frm.type.value			= 'editUser';
	var oldPw	 			= document.createElement("input");
	oldPw.name 				= "oldPassword";
	oldPw.type			= "hidden";
	oldPw.value			= "<?php echo $post['password'];?>";
	frm.appendChild(oldPw);
	var id		 			= document.createElement("input");
	id.name 				= "id";
	id.type					= "hidden";
	id.value				= "<?php echo $post['id'];?>";
	frm.appendChild(id);
	frm.number.value		= "<?php echo $post['phone'];?>";
	frm.email.value		= "<?php echo $post['email'];?>";
	frm.sex.value		= "<?php echo $post['sex'];?>";
	frm.status.value		= <?php echo $post['status'];?>;
	frm.password.value		= "<?php echo $post['password'];?>";
	frm.password2.value		= "<?php echo $post['password'];?>";
	document.getElementById("frmTitle").innerHTML = 'Update User';
</script>		
	<?php
		}
	?>